<?php
class About extends CI_Controller
{
	public function __construct(){
		parent::__construct();
		$this->load->helper('url');
	}
	public  $_data =array(); 
	
	public function index($link =null){
//		print_r($link);
//		die('oooo');
		if(!$link){
			$a = $this->db->get('about');
		}else{
			if($link == 'sysset') $this->sysset();
			$a = $this->db->get_where('about', array('link'=>$link));
		}
		
		$a = $a->result();
		if(!$a || !$a[0]){
			show_404();
		}
		$a = $a[0];
		
		
		$this->_data['data'] = $a;
		$this->_data['title'] = $a->title;

		$this->load->view('about', $this->_data);
	}

	/**
	* 网站整体配置
	*/
	public function sysset(){
		$o = $this->db->query("SELECT * FROM {$this->db->dbprefix}sysset WHERE domain='".SITE_DOMAINNAME."'");
		
		$data = $o->result();
		if($data && $data[0]){
			$data = $data[0];
		}else{
			$data = array();
		}
		$this->_data['data'] = $data;

		if($this->input->get('ajax')){
			echo json_encode($data);exit();
		}
	}
	
	
}